home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 103_01 / edit.doc < prev    next >
Text File  |  1985-03-09  |  10KB  |  325 lines

  1.     The Fantastic Great Wonderful EDIT 
  2.         by Scott Fluhrer
  3.            and Neal Somos
  4.         
  5.     This file created May 7, 1981 by Kathy Bacon.
  6.  
  7.     This is supposed to be a help file for Scott's QED editor
  8. in BDS C. When in EDIT itself, you can get a brief listing of the
  9. available commands, but here I tried to give a little more explan-
  10. ation and a few examples of some of the niftier features, for anyone
  11. who hasn't used an editor of this type before.
  12.  
  13. EDIT can be invoked by typing
  14.  
  15.     A>EDIT x:filename <cr>
  16.  
  17. where both the filename and drive designation are optional.
  18.  
  19.  
  20.     Comment 1) After any change that rearranges lines, the line
  21. numbers are automatically adjusted, so it's a good idea to look at the
  22. code again before you make any more changes, to check out the new line
  23. numbers - unless you LIKE suprise deletions and substitutions, in which
  24. case, by ALL MEANS go ahead and live dangerously!
  25.  
  26.     Comment 2) Whenever I say, "specified range of lines", I mean
  27. two numbers separated by a comma, like    1,3     or      10,999.
  28.  
  29.     Comment 3) A dollar sign ($) stands for the last line of
  30. the file; within a search string it stands for end-of-line. A period
  31. (.) stands for the current line in the file; within a search string
  32. it stands for "any character" - a sort of wild card.
  33.     
  34.  
  35.  
  36. ********************************************************************
  37.         Miscellaneous Commands
  38. ********************************************************************
  39. COMMAND        DESCRIPTION
  40.  
  41. Control-P    Will send everything typed on the screed thereafter
  42.         to the printer. To stop, type another Control-P.
  43.  
  44.    h        Will list a brief description of all commands
  45.  
  46.    u        This is the "user-defined-command". To set it, you
  47.         just say    u=com   and u is set equal to "com".
  48.         "com" can be anything you want - a complicated
  49.         search-and-substitute you'll be doing a lot,
  50.         a  ".,$" , or whatever.
  51.  
  52.    #        Toggles the line numbers on or off.
  53.  
  54.    <        Turns the prompts on.
  55.  
  56.    >        Turns the prompts off.
  57.  
  58.    =        Has various uses:
  59.  
  60.         f=file    sets default filename to "file"
  61.         $=    tells you last line number
  62.         .=    tells you current line number (useful if
  63.                 you've turned off the numbers)
  64.         u=com    sets the user command to "com"
  65.         u=    tells you what the user command is
  66.  
  67. ***************************************************************
  68.                 Commands Concerning Files
  69. ***************************************************************
  70. I know, I know, they're ALL concerned with files, but read on...
  71.  
  72. COMMAND    
  73.  
  74. r x:filename    Reads in file "filename" from drive x. The default
  75.         is the currently logged in disk if no designation 
  76.         is given.
  77.  
  78. w x:filename    Writes "filename" to disk x. Again, "x" is optional.
  79.         So, for that matter, is the filename: if you don't
  80.         specify, it will use the current default filename
  81.         (there is a default even if you've never specified
  82.         one during your EDITing - it USED to write out a 
  83.         file with the descriptive title " ", but that wasn't
  84.         too cool...)
  85.  
  86. f         Tells you the current default filename.
  87.  
  88. f=file            Sets the default filename to "file".
  89.  
  90. q        Quits the editor. If you try to quit without first
  91.         writing the file (via "w") to disk, EDIT will scream
  92.         (well, ACTUALLY it will only BEEP) at you. If you 
  93.         don't want your most recent changes anyway, and you
  94.         find this  behavior obnoxious, read on...
  95.  
  96. q!        Quits quietly.
  97.  
  98. n x:filename    This command will cause "filename" to be read form
  99.         drive x and be used to EDIT the file you are in -
  100.         i.e. "filename" should be a file of EDIT commands.
  101.         This can be used to add one of your files to 
  102.         another (there's no explicit command for this).
  103.         Copy the text you want to add into a file, precede
  104.         it with an "a" for append, and follow it with a
  105.         period ".", and then use the file to EDIT the 
  106.         file you want to add the text to.
  107.  
  108.     NOTE!!    If a filename is not specified, it will use the
  109.         current default filename - which will probably
  110.         NOT contain EDIT commands....
  111.  
  112.  
  113. ****************************************************************
  114.         Commands Concerning Lines
  115. ****************************************************************
  116.  
  117. (line#)a    APPENDS lines of text AFTER the (optional) line
  118.         number. To stop, type a single period (.) on a line.
  119.  
  120. (line#)ac    APPEND COMMENT to (line#). This will automatically
  121.         add a "/*" onto the line you specify - you then
  122.         type in the text of your comment, and hit <cr>,
  123.         and it adds the closing "*/".
  124.  
  125. (range)c       CHANGES the line or lines specified. To stop, type
  126.         a single period on a line.
  127.  
  128. (range)d    DELETES the line or range of lines specified.
  129.  
  130. (line#)i    INSERTS lines of text BEFORE the (opt.) line
  131.         number. To stop, type a single period (.) on a 
  132.         line.
  133.  
  134. (line#)j    JOINS the line following "line#" to the end
  135.         of "line#", making the two one line.
  136.  
  137.  
  138. (range)m(dest)    MOVES the range of lines specified to the 
  139.         destination specified. They are deleted from 
  140.         their original location.
  141.  
  142. (range)t(dest)    COPIES the range of lines specified to the
  143.         destination specified. The lines are NOT 
  144.         deleted form their original location.
  145.  
  146.     Example:
  147.  
  148. 141>a
  149. 142    line one of ridiculous text
  150. 143    line two
  151. 144     third boring line
  152. 145    fourth insipid line
  153. 146    boring boring boring
  154. 147    .
  155. 146>142,143m146
  156. 146>142,146
  157. 142    third boring line
  158. 143    fourth insipid line
  159. 144    line one of ridiculous text
  160. 145    line two
  161. 146    boring boring boring
  162. 146>146t142
  163. 146>142,147
  164. 142    boring boring boring
  165. 143    third boring line
  166. 144    fourth insipid line
  167. 145    line one of ridiculous text
  168. 146    line two
  169. 147    boring boring boring
  170.  
  171. ***********************************************************
  172.         Print Commands
  173. ***********************************************************
  174.  
  175. All line number designations for these commands are OPTIONAL.
  176.     --------------------------------------------------
  177.  
  178. (line#)p    Displays the line designated, and sets dot (.) to
  179.         "line#".
  180.  
  181. (range)l    Displays the range of lines specified, showing
  182.         all control characters as up-arrows followed
  183.         by some character. A tab (^I) is the only control
  184.         character that this editor ALLOWS you to put in,
  185.         but other sneaky little devils culd creep in...
  186.  
  187. (range)        Displays the range specified with all control
  188.         characters shown as an up-arrow followed by a 
  189.         letter . The only control character this editor
  190.         will allow you to insert is a tab (^I) but others
  191.         may creep in, the sneaky little devils.
  192.  
  193.  
  194. (line#):    Prints from (line#) to (line# + 16); sets dot equal
  195.         to (line#).
  196.  
  197. (line#)&    Prints from (line# - 16) to (line#), leaves dot at
  198.         (line#).
  199.  
  200. (line#)"    Prints from (line# + 1) up to (line# + 17), leaves
  201.         dot at (line#).
  202.  
  203. (line#)~    Prints from (line# - 16) up to (line#), sets dot
  204.         to (line# - 16).
  205.  
  206. (line#)%    Prints from (line# - 8) up to (line# + 8) to
  207.         show the context of a line.
  208.  
  209.  
  210. *****************************************************************
  211.         Search and Substitute Commands
  212. *****************************************************************
  213.  
  214. These come in several flavors.....depending on your tastes...
  215.  
  216.  
  217. The General "Searches":
  218. ----------------------
  219.  
  220. /string/    Will search FORWARD through the file for the next
  221.         occurrence of "string", and print it out.
  222.  
  223. ?string?    Will search BACKWARD through the file for the last
  224.         occurrence of "string". A "print" is implied.
  225.  
  226.  
  227. g/string/    Will search and print out all occurrences of 
  228.         "string" in the file.
  229.  
  230. v/string/    Will print out all lines in the file which DO
  231.         NOT contain "string".
  232.  
  233.  
  234.  
  235. The "Search and Substitutes":
  236. ---------------------------
  237.  
  238. (range)s/search/replace/    Will substitute "replace" for the
  239.                 FIRST occurrence of "search" on all
  240.                 lines in "range".
  241.  
  242. (range)s/search/replace/p    Will do the same, but will print the
  243.                 final result.
  244.  
  245. (range)s/search/replace/gp    Will substitute for ALL occurrences
  246.                 on each line.
  247.  
  248.  
  249.  
  250. The "Interactive Substitute":
  251. ----------------------------
  252.  
  253. (range)x/search/replace/p    Will search and display each 
  254.                 occurrence (singly, of course!)
  255.                 of "search" in "range". The search
  256.                 string will be marked on each
  257.                 line by up-arrows (^); if a tab i